package org.fkit.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;



public class HelloController implements Controller {
	private static final Log logger = LogFactory.getLog(HelloController.class);

	public HelloController() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		logger.info("handleRequest 被调用了");
		ModelAndView mv = new ModelAndView();
		mv.addObject("message", "Hello World! 123");//添加模型数据，可以是任意的POJO对象。
		mv.setViewName("/WEB-INF/content/welcome.jsp");//设置逻辑视图名，视图解析器会根据该名字解析到具体的视图页面。
		return mv;
	}

}
